package org.devocean.groupbuying.web.frontend;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import org.devocean.groupbuying.domain.Deal;
import org.devocean.groupbuying.service.DealService;
import org.devocean.groupbuying.service.MenuService;
import org.devocean.groupbuying.web.frontend.displaybeans.CartBean;
import org.devocean.groupbuying.web.frontend.displaybeans.DealBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.CookieValue;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping(value = { "/{lang:[a-z]{2}}/menu" })
// @RequestMapping(value={"", "/{lang:[a-z]{2}}"})
public class MenuController {

	@Autowired
	private MenuService menuService;

	@RequestMapping("")
	public String deals(Map<String, Object> map,
			@CookieValue("clientLanguage") String lang) {
		map.put("menus", menuService.getAllMenus(lang));
		return "allDeals";
	}

}
